Skip to content

Daily Test Coverage Improver: Add tests for AsyncSeqExtensions and Seq modules#182

Merged
dsyme merged 1 commit intomainfrom
feature/test-coverage-improvements-extensions-seq
Aug 29, 2025
Merged

Daily Test Coverage Improver: Add tests for AsyncSeqExtensions and Seq modules#182
dsyme merged 1 commit intomainfrom
feature/test-coverage-improvements-extensions-seq

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

  • Added 6 comprehensive tests covering previously untested AsyncSeqExtensions and Seq modules
  • Achieved 100% coverage for both AsyncSeqExtensions and Seq modules (up from 0%)
  • Test count increased from 128 → 134 tests
  • All tests pass successfully

Problems Found

  • AsyncSeqExtensions module: Had 0% coverage despite being a critical module that extends async computation builder with AsyncSeq support
  • Seq module: Had 0% coverage for the ofAsyncSeq utility function

Actions Taken

AsyncSeqExtensions Tests (3 tests):

  • async.For with AsyncSeq - Tests basic iteration over AsyncSeq within async computation
  • async.For with empty AsyncSeq - Tests edge case with empty sequences
  • async.For with exception in AsyncSeq - Tests exception propagation through async.For

Seq Module Tests (3 tests):

  • Seq.ofAsyncSeq should work - Tests conversion of AsyncSeq to blocking sequence
  • Seq.ofAsyncSeq with empty AsyncSeq - Tests edge case with empty sequences
  • Seq.ofAsyncSeq with exception - Tests exception handling during conversion

Changes in Test Coverage Achieved

Before:

  • Line Coverage: 86.0% (1,045/1,215 lines)
  • Method Coverage: 87.7% (535/610 methods)
  • AsyncSeqExtensions: 0% coverage
  • Seq: 0% coverage

After:

  • Line Coverage: 86.1% (1,047/1,215 lines) - +2 lines
  • Method Coverage: 88.0% (537/610 methods) - +2 methods
  • AsyncSeqExtensions: 100% coverage ✅
  • Seq: 100% coverage ✅

Other Areas for Future Improvement

Based on coverage analysis, remaining improvement opportunities:

  • AsyncSeqOp<T>: 33.3% coverage (2 uncovered methods)
  • Utils module: 79.6% coverage (12 uncovered lines)
  • Main AsyncSeq module: Still has 65 uncovered branches for edge cases

Commands to validate coverage numbers:

dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
reportgenerator -reports:"coverage/**/coverage.cobertura.xml" -targetdir:"coverage/report" -reporttypes:"JsonSummary"
cat coverage/report/Summary.json
Bash commands executed
  • git checkout -b feature/test-coverage-improvements-extensions-seq
  • dotnet build --no-restore
  • dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage-new
  • reportgenerator -reports:"coverage-new/**/coverage.cobertura.xml" -targetdir:"coverage-new/report" -reporttypes:"JsonSummary"
  • git add tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqTests.fs tests/FSharp.Control.AsyncSeq.Tests/FSharp.Control.AsyncSeq.Tests.fsproj
  • git commit -m "..."
  • git push -u origin feature/test-coverage-improvements-extensions-seq
Web searches performed

None - worked with existing codebase analysis.

Web pages fetched

None - worked with existing codebase analysis.

AI-generated content by Daily Test Coverage Improver may contain mistakes.

…q modules

- Add 6 new tests covering AsyncSeqExtensions and Seq module functions
- AsyncSeqExtensions coverage: 0% → 100%
- Seq module coverage: 0% → 100%
- Overall test count: 128 → 134 tests
- Line coverage improvement: 86.0% → 86.1% (1,045 → 1,047 lines)
- Method coverage improvement: 87.7% → 88.0% (535 → 537 methods)

Tests added:
- async.For with AsyncSeq (basic functionality)
- async.For with empty AsyncSeq (edge case)
- async.For with exception in AsyncSeq (error handling)
- Seq.ofAsyncSeq basic functionality
- Seq.ofAsyncSeq with empty AsyncSeq
- Seq.ofAsyncSeq with exception handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dsyme dsyme closed this Aug 29, 2025
@dsyme dsyme reopened this Aug 29, 2025
@dsyme dsyme merged commit d8cbc9e into main Aug 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants